<script type="text/ng-template" id="taskSave.html">
    <div>
        <div class="col-sm-22 modal-body">
            <table class="table table-hover table-bordered text-center">
                <thead>
                    <tr>
                        <th width="80px">编号</th>
                        <th width="100px">任务类型</th>
                        <th width="280px">内容</th>
                        <th width="220px">指派给</th>
                        <th width="100px">工时</th>
                        <th width="50px">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="i in info.taskList">
                        <td>
                            {{i.taskNo}}
                        </td>
                        <td>
                            <winit-select on-init="true" modeldata="i.type"
                              optiondata="value" optiondata-value="key"
                              datalist="info.taskTypes" widthdata="100px"></winit-select>
                        </td>
                        <td>
                            <input type="text" class="form-control form-input-title" ng-model="i.content" placeholder="请输入内容">
                        </td>
                        <td>
                            <m-ui-select prompt="请选择指派人" selected-item ="i.user" itme-list="info.userList">
                    
                            </m-ui-select>
                        </td>
                        <td>
                           <winit-text-number
                                        number-data="i.workHours"></winit-text-number>
                        </td>
                        <td>
                            <i class="glyphicon glyphicon-plus i_class ng-scope" role="button" tabindex="0" ng-click="addTask($index)"></i>
                            <i class="glyphicon glyphicon-remove i_class ng-scope" role="button" tabindex="0" ng-click="delTask(i)"></i>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="col-sm-12 modal-body">
            <div class="col-sm-1">
                <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="allUser()" ng-disabled="info.allUser==null">批量指派</button>
            </div>
            <div class="col-sm-2">
                <m-ui-select prompt="请选择指派人" selected-item ="info.allUser" itme-list="info.userList"></m-ui-select>
            </div>
            <div class="col-sm-9">
            </div>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-primary" ng-click="save()" ng-disabled="showSave()">创建任务</button>
            <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="cancel()">取消</button>
        </div>
    </div>
</script>

<script type="text/ng-template" id="AloneTaskSave.html">
    <div>
        <div class="col-sm-22 modal-body">
            <form class="form-horizontal">
                <div class="form-group">
                    <label class="col-sm-2 control-label">编号：</label>
                    <div class="col-sm-10">
                        <span>{{info.task.taskNo}}</span>
                    </div>
                </div>
                <div class="line-lg pull-in" style="margin-top: 8px;margin-bottom: 8px;"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">任务类型:</label>
                    <div class="col-sm-10">
                        <winit-select on-init         = "true" 
                                      modeldata       = "info.task.type"
                                      optiondata      = "value" 
                                      optiondata-value= "key"
                                      datalist        = "info.taskTypes" 
                                      widthdata       = "100px"
                                      >
                        </winit-select>
                    </div>
                </div>
                <div class="line-lg pull-in" style="margin-top: 8px;margin-bottom: 8px;"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">任务内容:</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control form-input-title " ng-model="info.task.content" placeholder="请输入内容,不超过20个字">
                    </div>
                </div>
                <div class="line-lg pull-in" style="margin-top: 8px;margin-bottom: 8px;"></div>
                <div class="form-group">
                    <div class="form-group">
                       <label class="col-sm-2 control-label">开始时间:</label>
                        <div class="col-sm-3">
                             <m-datepicker select-dt="info.task.startupTime"></m-datepicker>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="form-group">
                       <label class="col-sm-2 control-label">时长:</label>
                        <div class="col-sm-3">
                            <winit-text-number
                                        number-data="info.task.workHours"
                                        number-max="34"></winit-text-number>
                        </div>
                    </div>
                </div> 
                <div class="form-group">
                    <div class="form-group">
                       <label class="col-sm-2 control-label">负责人:</label>
                        <div class="col-sm-3">
                            <m-single-select-user prompt="请选择项目负责人"
                                                  selected-user="info.task.user"
                                                  uidefault="true"
                                                >
                            </m-single-select-user>
                        </div>
                    </div>
                </div>
            </form>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-primary" ng-click="save()" ng-disabled="showSave()">保存</button>
            <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="cancel()">取消</button>
        </div>
    </div>
</script>